/**
 * @name ast-gen
 * @id python/ast-gen
 */

import python
import util


from File f,AstNode node,Scope scope,string node_type,string node_value,string filepath,string location,boolean isLeaf
where
node.getScope().getEnclosingModule().getFile()=f
and
filepath=f.getAbsolutePath()
and
isSource(f)
and
scope=node.getScope()
and
isLeaf=isLeavesNode(node)
and
prepare_ast_node_id(node, node_type, node_value, location)
select node_type,node_value,scope,filepath,location,isLeaf

// from File f,AstNode parent,AstNode child,string filepath,string location
// where
// parent.getScope().getEnclosingModule().getFile()=f
// and
// child.getParentNode()=parent
// and
// location=getLocText(child.getLocation())
// and
// filepath=f.getAbsolutePath()
// and
// isSource(f)
// select parent,child,filepath,location